<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"  %>
<%--
  Created by IntelliJ IDEA.
  User: 19238
  Date: 2021/11/11
  Time: 9:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"  %>
<%@page isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
    <style>
/*隔行变色*/
        table tr:nth-child(odd)
        {
            background: lightskyblue;
        }
    </style>
</head>
<script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>

<body>
<form>
    <h3>驾校查询</h3>

        <select name="category_level1" class="form-control"   required="required" id="cityAreaId">

            <input type="button" id="btn" value="查询"/>
        </select>

    <table border="1" id="add">
        <tr>
            <th>驾校名称</th><th>所在城区</th><th>地址</th><th>联系电话</th><th>操作</th>
        </tr>
        <c:forEach var="appInfo" items="${gamelist}" varStatus="status">
    <tr role="row" class="odd">

    <td>${appInfo.name }</td>
    <td>${appInfo.address }</td>
    <td>${appInfo.cityAreaid }</td>
    <td>${appInfo.phone }</td>
    <td><a href="/kaoShig_war_exploded/XiuGai?id=${appInfo.id}">修改</a> </td>
    </tr>
        </c:forEach>
    </table>


     <%--   <c:forEach var="list" items="${list}" varStatus="status">
            <tr>
                 &lt;%&ndash; <td>${list.address }</td>
                <td>${list.address }</td>&ndash;%&gt;
                <td>${list.address }</td>
                <td>${list.phone }</td>
            </tr>
        </c:forEach>--%>
</form>
<script>

    $(function(){
    /*    $.ajax({
            url:"/kaoShig_war_exploded/app/sc",

            type:"GET",
            dataType:"json",
            success:function(result){
                //console.log(result);
                //解析数据在表格中将员工数据显示出来
                for(var i=0;i<result.length;i++){
                    //$("#neirong").append("<div class='am-comment-bd'> <div id='tb-rev-item'>"+res[i].evaluate_id+res[i].evaluate+"</div></div>");
                    //$("#pinglun").append("<li class='am-comment'>"+res[i].evaluate_id+res[i].evaluate+"</li>");
/!*
                    $("#add").append("<tr><td>"+result[i].name+"</td>"+"<td>"+result[i].address+"</td>"+"<td>"+result[i].cityAreaid+"</td>"+"<td>"+result[i].phone+"</td><td><a href='#'>操作</a></td></tr>");
*!/

                }
                //解析数据在右下角将导航信息显示出来
            }
        });
*/
        $.ajax({
            "url":"/kaoShig_war_exploded/selCa",
            "type":"post",
            "dataType":"json",
            "success":function(r){
                $('#cityAreaId').html("")
                var data = r.result["list"]
                for(var i = 0; i < data.length; i++){
                    var html2 = "";
                    var num = i+1;
                    html2+='<option value='+num+'>'+data[i].name+'</option>'
                    $('#cityAreaId').append(html2);
                }
            },
            "error":function(){
                alert("服务器错误");
            }
        });
    });
</script>
<p>一共${p.pages}页</p>
<a href="${pageContext.request.contextPath }/app/school?page=${p.firstPage}">第一页</a>&nbsp;
<a href="${pageContext.request.contextPath }/app/school?page=${p.prePage}"><span><</span>上一页</a>&nbsp;
<a href="${pageContext.request.contextPath }/app/school?page=${p.nextPage}">下一页<span>></span></a>&nbsp;
<a href="${pageContext.request.contextPath }/app/school?page=${p.lastPage}">最后页</a>&nbsp; &nbsp;
当前:第 ${p.pageNum}页
</body>


</html>
